﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.ComponentModel;
using Web7.Domain;

namespace Web7.Core.Security
{
    [Serializable]
    public class Permission : Entity
    {

        public virtual string Name { get; set; }

        public virtual string ActionName { get; set; }

        public virtual string FeatureName { get; set; }

        public virtual string Description { get; set; }

        //[DisplayName("所属权限")]
        //public virtual Guid? ParentID { set; get; }

        //[DisplayName("显示顺序")]
        //public virtual int DisplayOrder { set; get; }
    }

    public class PermissionRecord<Tid> : Entity
    {
        public virtual string PermissionName { get; set; }

        public virtual Tid OwnerId { get; set; }

        public virtual Tid FilterId { get; set; }

        public virtual Tid ActionId { get; set; }

        public virtual PermissionOwnerType OwnerType { get; set; }
    }

    public class PermissionRecord : PermissionRecord<Guid>
    {

    }
    public enum PermissionOwnerType
    {
        User,
        Role
    }
}
